package com.caiyi.financial.nirvana.sms.service;

import com.caiyi.financial.nirvana.sms.base.service.BaseService;
import com.caiyi.financial.nirvana.sms.entity.SmsReceiveMessage;
import com.caiyi.financial.nirvana.sms.enums.ReturnCodeEnum;
import com.caiyi.financial.nirvana.sms.mapper.SmsReceiveMessageMapper;
import com.caiyi.financial.nirvana.sms.querybean.PageBean;
import com.caiyi.financial.nirvana.sms.querybean.QueryReceiveMessage;
import com.youyu.common.api.Result;
import com.github.pagehelper.PageHelper;
import com.youyu.common.enums.BaseResultCode;
import com.youyu.common.utils.YyAssert;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class SmsReceiveMessageService extends BaseService<SmsReceiveMessage> {

    @Autowired
    private SmsReceiveMessageMapper smsReceiveMessageMapper;

    public PageBean<SmsReceiveMessage> getReceiveMessageListByParams(QueryReceiveMessage bean) {
        PageBean<SmsReceiveMessage> pageBean = null;
        PageHelper.startPage(bean.getPageNum(), bean.getPageSize());
        List<SmsReceiveMessage> list = smsReceiveMessageMapper.getReceiveMessageListByParams(bean);
        pageBean = new PageBean<>(list);
        logger.info("getReceiveMessageListByParams success... 帐号 {}", bean.getAccount());
        return pageBean;
    }

}
